package com.hcyy.util;

public class SidUtil {
	public static String createSid(String dwbh,String lastsid,Integer sjid){
		int num=0;
		if(lastsid!=null&&lastsid.trim()!=""){
			num=num+Integer.parseInt(lastsid.substring(7));
		}
		num+=1;
		String count="000"+num;
		String prefix="";
		switch (sjid){
		case 1:
			prefix="M";
			break;
		case 2:
			prefix="N";
			break;
		}
		String sid=prefix+dwbh.substring(5)+count.substring(count.length()-4, count.length());
		return sid;
	}
	
	public static void main(String[] args) {
		String dwbh="DWI00000004";
		String lastsid="M000009001";
		Integer sjid=2;
		System.out.println(SidUtil.createSid(dwbh, lastsid,sjid));
	}
}
